/**
 * Copyright @2016-present, Sumscope, Inc.
 * All rights reserved.
 */

module.exports = (options, initialState) => {
  return `
    <!doctype html>
    <html lang="zh-CN">
      <head>
        <link rel="icon" href="/images/favicon.ico" type="image/x-icon" />
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
        <title>${options.title}</title>
        ${options.css.map(css => `<link rel="stylesheet" href="${css}" type="text/css" />`).join('\n')}
      </head>
      <body>
        <container id="app">${options.initialHtml}</container>
        <script>
          window.__INITIAL_STATE__ = ${JSON.stringify(initialState)}
        </script>
        ${options.js.map(js => `<script src="${js}"></script>`).join('\n')}
      </body>
    </html>
  `
};
